package kr.co.valueworks.fishing.widget;

import kr.co.valueworks.fishing.R;
import android.content.Context;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.inputmethod.EditorInfo;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.TextView.OnEditorActionListener;

public class FishingSearchWidget extends LinearLayout {

	public FishingSearchWidget(Context context) {
		super(context);
		init();
	}

	public FishingSearchWidget(Context context, AttributeSet attrs) {
		super(context, attrs);
		init();
	}
	
	void init(){
		LayoutInflater inflater = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		inflater.inflate(R.layout.search_form, this, true);
		
		/*
		final EditText editText = (EditText)findViewById(R.id.searchEditText);
		final ImageButton imgBtn = (ImageButton)findViewById(R.id.searchBtn);
		editText.setOnEditorActionListener(new OnEditorActionListener() {
			
			@Override
			public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
				
                if(actionId == EditorInfo.IME_ACTION_SEARCH){ // IME_ACTION_SEARCH , IME_ACTION_GO
                	imgBtn.dispatchTouchEvent(MotionEvent.obtain(null));
                 }				
				return false;
			}
		});
		*/
	}

}
